 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

JCLOUD DETECTION SUBSCRIBE API
detection API

OpenAPI spec version: v2
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKDetection/DetectionExecutor.h>

@implementation DetectionClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"detection.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 detection  v2";
    _serviceName = @"detection";
    _version = @"v2";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 detection  v2";
    _serviceName = @"detection";
    _version = @"v2";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"detection.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 detection  v2";
    _serviceName = @"detection";
    _version = @"v2";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 detection  v2";
    _serviceName = @"detection";
    _version = @"v2";
    self.contentType = @"application/json";
    return self;
}


/**
validateSiteMonitorAddress sync request
@param validateSiteMonitorAddressRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `validateSiteMonitorAddressResponse` the request response data model
*/
-(NSDictionary*) validateSiteMonitorAddressSyncWithRequest:(DetectionValidateSiteMonitorAddressRequest*) validateSiteMonitorAddressRequest
{
DetectionValidateSiteMonitorAddressExecutor* excutor = [[DetectionValidateSiteMonitorAddressExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:validateSiteMonitorAddressRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionValidateSiteMonitorAddressResponse* response = [[DetectionValidateSiteMonitorAddressResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"validateSiteMonitorAddressResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)validateSiteMonitorAddressAsyncWithRequest:(DetectionValidateSiteMonitorAddressRequest*) validateSiteMonitorAddressRequest
                       completionHandler:(void(^)(int statusCode,DetectionValidateSiteMonitorAddressResponse* _Nullable validateSiteMonitorAddressResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionValidateSiteMonitorAddressExecutor* excutor = [[DetectionValidateSiteMonitorAddressExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:validateSiteMonitorAddressRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionValidateSiteMonitorAddressResponse* response = [[DetectionValidateSiteMonitorAddressResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
testSiteMonitor sync request
@param testSiteMonitorRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `testSiteMonitorResponse` the request response data model
*/
-(NSDictionary*) testSiteMonitorSyncWithRequest:(DetectionTestSiteMonitorRequest*) testSiteMonitorRequest
{
DetectionTestSiteMonitorExecutor* excutor = [[DetectionTestSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:testSiteMonitorRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionTestSiteMonitorResponse* response = [[DetectionTestSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"testSiteMonitorResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)testSiteMonitorAsyncWithRequest:(DetectionTestSiteMonitorRequest*) testSiteMonitorRequest
                       completionHandler:(void(^)(int statusCode,DetectionTestSiteMonitorResponse* _Nullable testSiteMonitorResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionTestSiteMonitorExecutor* excutor = [[DetectionTestSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:testSiteMonitorRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionTestSiteMonitorResponse* response = [[DetectionTestSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createProbeTask sync request
@param createProbeTaskRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createProbeTaskResponse` the request response data model
*/
-(NSDictionary*) createProbeTaskSyncWithRequest:(DetectionCreateProbeTaskRequest*) createProbeTaskRequest
{
DetectionCreateProbeTaskExecutor* excutor = [[DetectionCreateProbeTaskExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createProbeTaskRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionCreateProbeTaskResponse* response = [[DetectionCreateProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createProbeTaskResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createProbeTaskAsyncWithRequest:(DetectionCreateProbeTaskRequest*) createProbeTaskRequest
                       completionHandler:(void(^)(int statusCode,DetectionCreateProbeTaskResponse* _Nullable createProbeTaskResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionCreateProbeTaskExecutor* excutor = [[DetectionCreateProbeTaskExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createProbeTaskRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionCreateProbeTaskResponse* response = [[DetectionCreateProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
enableSiteMonitor sync request
@param enableSiteMonitorRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `enableSiteMonitorResponse` the request response data model
*/
-(NSDictionary*) enableSiteMonitorSyncWithRequest:(DetectionEnableSiteMonitorRequest*) enableSiteMonitorRequest
{
DetectionEnableSiteMonitorExecutor* excutor = [[DetectionEnableSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:enableSiteMonitorRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionEnableSiteMonitorResponse* response = [[DetectionEnableSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"enableSiteMonitorResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)enableSiteMonitorAsyncWithRequest:(DetectionEnableSiteMonitorRequest*) enableSiteMonitorRequest
                       completionHandler:(void(^)(int statusCode,DetectionEnableSiteMonitorResponse* _Nullable enableSiteMonitorResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionEnableSiteMonitorExecutor* excutor = [[DetectionEnableSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:enableSiteMonitorRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionEnableSiteMonitorResponse* response = [[DetectionEnableSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
updateProbeTask sync request
@param updateProbeTaskRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `updateProbeTaskResponse` the request response data model
*/
-(NSDictionary*) updateProbeTaskSyncWithRequest:(DetectionUpdateProbeTaskRequest*) updateProbeTaskRequest
{
DetectionUpdateProbeTaskExecutor* excutor = [[DetectionUpdateProbeTaskExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:updateProbeTaskRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionUpdateProbeTaskResponse* response = [[DetectionUpdateProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"updateProbeTaskResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)updateProbeTaskAsyncWithRequest:(DetectionUpdateProbeTaskRequest*) updateProbeTaskRequest
                       completionHandler:(void(^)(int statusCode,DetectionUpdateProbeTaskResponse* _Nullable updateProbeTaskResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionUpdateProbeTaskExecutor* excutor = [[DetectionUpdateProbeTaskExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:updateProbeTaskRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionUpdateProbeTaskResponse* response = [[DetectionUpdateProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeProbeHistory sync request
@param describeProbeHistoryRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeProbeHistoryResponse` the request response data model
*/
-(NSDictionary*) describeProbeHistorySyncWithRequest:(DetectionDescribeProbeHistoryRequest*) describeProbeHistoryRequest
{
DetectionDescribeProbeHistoryExecutor* excutor = [[DetectionDescribeProbeHistoryExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeProbeHistoryRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeProbeHistoryResponse* response = [[DetectionDescribeProbeHistoryResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeProbeHistoryResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeProbeHistoryAsyncWithRequest:(DetectionDescribeProbeHistoryRequest*) describeProbeHistoryRequest
                       completionHandler:(void(^)(int statusCode,DetectionDescribeProbeHistoryResponse* _Nullable describeProbeHistoryResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDescribeProbeHistoryExecutor* excutor = [[DetectionDescribeProbeHistoryExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeProbeHistoryRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeProbeHistoryResponse* response = [[DetectionDescribeProbeHistoryResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteProbeTask sync request
@param deleteProbeTaskRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteProbeTaskResponse` the request response data model
*/
-(NSDictionary*) deleteProbeTaskSyncWithRequest:(DetectionDeleteProbeTaskRequest*) deleteProbeTaskRequest
{
DetectionDeleteProbeTaskExecutor* excutor = [[DetectionDeleteProbeTaskExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteProbeTaskRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDeleteProbeTaskResponse* response = [[DetectionDeleteProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteProbeTaskResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteProbeTaskAsyncWithRequest:(DetectionDeleteProbeTaskRequest*) deleteProbeTaskRequest
                       completionHandler:(void(^)(int statusCode,DetectionDeleteProbeTaskResponse* _Nullable deleteProbeTaskResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDeleteProbeTaskExecutor* excutor = [[DetectionDeleteProbeTaskExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteProbeTaskRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDeleteProbeTaskResponse* response = [[DetectionDeleteProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteSiteMonitor sync request
@param deleteSiteMonitorRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteSiteMonitorResponse` the request response data model
*/
-(NSDictionary*) deleteSiteMonitorSyncWithRequest:(DetectionDeleteSiteMonitorRequest*) deleteSiteMonitorRequest
{
DetectionDeleteSiteMonitorExecutor* excutor = [[DetectionDeleteSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteSiteMonitorRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDeleteSiteMonitorResponse* response = [[DetectionDeleteSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteSiteMonitorResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteSiteMonitorAsyncWithRequest:(DetectionDeleteSiteMonitorRequest*) deleteSiteMonitorRequest
                       completionHandler:(void(^)(int statusCode,DetectionDeleteSiteMonitorResponse* _Nullable deleteSiteMonitorResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDeleteSiteMonitorExecutor* excutor = [[DetectionDeleteSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteSiteMonitorRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDeleteSiteMonitorResponse* response = [[DetectionDeleteSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getSiteMonitorSource sync request
@param getSiteMonitorSourceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getSiteMonitorSourceResponse` the request response data model
*/
-(NSDictionary*) getSiteMonitorSourceSyncWithRequest:(DetectionGetSiteMonitorSourceRequest*) getSiteMonitorSourceRequest
{
DetectionGetSiteMonitorSourceExecutor* excutor = [[DetectionGetSiteMonitorSourceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getSiteMonitorSourceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionGetSiteMonitorSourceResponse* response = [[DetectionGetSiteMonitorSourceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getSiteMonitorSourceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getSiteMonitorSourceAsyncWithRequest:(DetectionGetSiteMonitorSourceRequest*) getSiteMonitorSourceRequest
                       completionHandler:(void(^)(int statusCode,DetectionGetSiteMonitorSourceResponse* _Nullable getSiteMonitorSourceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionGetSiteMonitorSourceExecutor* excutor = [[DetectionGetSiteMonitorSourceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getSiteMonitorSourceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionGetSiteMonitorSourceResponse* response = [[DetectionGetSiteMonitorSourceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeProbeTask sync request
@param describeProbeTaskRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeProbeTaskResponse` the request response data model
*/
-(NSDictionary*) describeProbeTaskSyncWithRequest:(DetectionDescribeProbeTaskRequest*) describeProbeTaskRequest
{
DetectionDescribeProbeTaskExecutor* excutor = [[DetectionDescribeProbeTaskExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeProbeTaskRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeProbeTaskResponse* response = [[DetectionDescribeProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeProbeTaskResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeProbeTaskAsyncWithRequest:(DetectionDescribeProbeTaskRequest*) describeProbeTaskRequest
                       completionHandler:(void(^)(int statusCode,DetectionDescribeProbeTaskResponse* _Nullable describeProbeTaskResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDescribeProbeTaskExecutor* excutor = [[DetectionDescribeProbeTaskExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeProbeTaskRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeProbeTaskResponse* response = [[DetectionDescribeProbeTaskResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeAgentStatus sync request
@param describeAgentStatusRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeAgentStatusResponse` the request response data model
*/
-(NSDictionary*) describeAgentStatusSyncWithRequest:(DetectionDescribeAgentStatusRequest*) describeAgentStatusRequest
{
DetectionDescribeAgentStatusExecutor* excutor = [[DetectionDescribeAgentStatusExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeAgentStatusRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeAgentStatusResponse* response = [[DetectionDescribeAgentStatusResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeAgentStatusResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeAgentStatusAsyncWithRequest:(DetectionDescribeAgentStatusRequest*) describeAgentStatusRequest
                       completionHandler:(void(^)(int statusCode,DetectionDescribeAgentStatusResponse* _Nullable describeAgentStatusResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDescribeAgentStatusExecutor* excutor = [[DetectionDescribeAgentStatusExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeAgentStatusRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeAgentStatusResponse* response = [[DetectionDescribeAgentStatusResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createSiteMonitor sync request
@param createSiteMonitorRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createSiteMonitorResponse` the request response data model
*/
-(NSDictionary*) createSiteMonitorSyncWithRequest:(DetectionCreateSiteMonitorRequest*) createSiteMonitorRequest
{
DetectionCreateSiteMonitorExecutor* excutor = [[DetectionCreateSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createSiteMonitorRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionCreateSiteMonitorResponse* response = [[DetectionCreateSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createSiteMonitorResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createSiteMonitorAsyncWithRequest:(DetectionCreateSiteMonitorRequest*) createSiteMonitorRequest
                       completionHandler:(void(^)(int statusCode,DetectionCreateSiteMonitorResponse* _Nullable createSiteMonitorResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionCreateSiteMonitorExecutor* excutor = [[DetectionCreateSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createSiteMonitorRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionCreateSiteMonitorResponse* response = [[DetectionCreateSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
discribeProbes sync request
@param discribeProbesRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `discribeProbesResponse` the request response data model
*/
-(NSDictionary*) discribeProbesSyncWithRequest:(DetectionDiscribeProbesRequest*) discribeProbesRequest
{
DetectionDiscribeProbesExecutor* excutor = [[DetectionDiscribeProbesExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:discribeProbesRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDiscribeProbesResponse* response = [[DetectionDiscribeProbesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"discribeProbesResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)discribeProbesAsyncWithRequest:(DetectionDiscribeProbesRequest*) discribeProbesRequest
                       completionHandler:(void(^)(int statusCode,DetectionDiscribeProbesResponse* _Nullable discribeProbesResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDiscribeProbesExecutor* excutor = [[DetectionDiscribeProbesExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:discribeProbesRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDiscribeProbesResponse* response = [[DetectionDiscribeProbesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeMetricDataAm sync request
@param describeMetricDataAmRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeMetricDataAmResponse` the request response data model
*/
-(NSDictionary*) describeMetricDataAmSyncWithRequest:(DetectionDescribeMetricDataAmRequest*) describeMetricDataAmRequest
{
DetectionDescribeMetricDataAmExecutor* excutor = [[DetectionDescribeMetricDataAmExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeMetricDataAmRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeMetricDataAmResponse* response = [[DetectionDescribeMetricDataAmResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeMetricDataAmResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeMetricDataAmAsyncWithRequest:(DetectionDescribeMetricDataAmRequest*) describeMetricDataAmRequest
                       completionHandler:(void(^)(int statusCode,DetectionDescribeMetricDataAmResponse* _Nullable describeMetricDataAmResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDescribeMetricDataAmExecutor* excutor = [[DetectionDescribeMetricDataAmExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeMetricDataAmRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeMetricDataAmResponse* response = [[DetectionDescribeMetricDataAmResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getSiteMonitor sync request
@param getSiteMonitorRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getSiteMonitorResponse` the request response data model
*/
-(NSDictionary*) getSiteMonitorSyncWithRequest:(DetectionGetSiteMonitorRequest*) getSiteMonitorRequest
{
DetectionGetSiteMonitorExecutor* excutor = [[DetectionGetSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getSiteMonitorRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionGetSiteMonitorResponse* response = [[DetectionGetSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getSiteMonitorResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getSiteMonitorAsyncWithRequest:(DetectionGetSiteMonitorRequest*) getSiteMonitorRequest
                       completionHandler:(void(^)(int statusCode,DetectionGetSiteMonitorResponse* _Nullable getSiteMonitorResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionGetSiteMonitorExecutor* excutor = [[DetectionGetSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getSiteMonitorRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionGetSiteMonitorResponse* response = [[DetectionGetSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
probeTaskEnable sync request
@param probeTaskEnableRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `probeTaskEnableResponse` the request response data model
*/
-(NSDictionary*) probeTaskEnableSyncWithRequest:(DetectionProbeTaskEnableRequest*) probeTaskEnableRequest
{
DetectionProbeTaskEnableExecutor* excutor = [[DetectionProbeTaskEnableExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:probeTaskEnableRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionProbeTaskEnableResponse* response = [[DetectionProbeTaskEnableResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"probeTaskEnableResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)probeTaskEnableAsyncWithRequest:(DetectionProbeTaskEnableRequest*) probeTaskEnableRequest
                       completionHandler:(void(^)(int statusCode,DetectionProbeTaskEnableResponse* _Nullable probeTaskEnableResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionProbeTaskEnableExecutor* excutor = [[DetectionProbeTaskEnableExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:probeTaskEnableRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionProbeTaskEnableResponse* response = [[DetectionProbeTaskEnableResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
updateSiteMonitor sync request
@param updateSiteMonitorRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `updateSiteMonitorResponse` the request response data model
*/
-(NSDictionary*) updateSiteMonitorSyncWithRequest:(DetectionUpdateSiteMonitorRequest*) updateSiteMonitorRequest
{
DetectionUpdateSiteMonitorExecutor* excutor = [[DetectionUpdateSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:updateSiteMonitorRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionUpdateSiteMonitorResponse* response = [[DetectionUpdateSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"updateSiteMonitorResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)updateSiteMonitorAsyncWithRequest:(DetectionUpdateSiteMonitorRequest*) updateSiteMonitorRequest
                       completionHandler:(void(^)(int statusCode,DetectionUpdateSiteMonitorResponse* _Nullable updateSiteMonitorResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionUpdateSiteMonitorExecutor* excutor = [[DetectionUpdateSiteMonitorExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:updateSiteMonitorRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionUpdateSiteMonitorResponse* response = [[DetectionUpdateSiteMonitorResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getSiteMonitorDataPoints sync request
@param getSiteMonitorDataPointsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getSiteMonitorDataPointsResponse` the request response data model
*/
-(NSDictionary*) getSiteMonitorDataPointsSyncWithRequest:(DetectionGetSiteMonitorDataPointsRequest*) getSiteMonitorDataPointsRequest
{
DetectionGetSiteMonitorDataPointsExecutor* excutor = [[DetectionGetSiteMonitorDataPointsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getSiteMonitorDataPointsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionGetSiteMonitorDataPointsResponse* response = [[DetectionGetSiteMonitorDataPointsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getSiteMonitorDataPointsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getSiteMonitorDataPointsAsyncWithRequest:(DetectionGetSiteMonitorDataPointsRequest*) getSiteMonitorDataPointsRequest
                       completionHandler:(void(^)(int statusCode,DetectionGetSiteMonitorDataPointsResponse* _Nullable getSiteMonitorDataPointsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionGetSiteMonitorDataPointsExecutor* excutor = [[DetectionGetSiteMonitorDataPointsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getSiteMonitorDataPointsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionGetSiteMonitorDataPointsResponse* response = [[DetectionGetSiteMonitorDataPointsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeProbeTasks sync request
@param describeProbeTasksRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeProbeTasksResponse` the request response data model
*/
-(NSDictionary*) describeProbeTasksSyncWithRequest:(DetectionDescribeProbeTasksRequest*) describeProbeTasksRequest
{
DetectionDescribeProbeTasksExecutor* excutor = [[DetectionDescribeProbeTasksExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeProbeTasksRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeProbeTasksResponse* response = [[DetectionDescribeProbeTasksResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeProbeTasksResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeProbeTasksAsyncWithRequest:(DetectionDescribeProbeTasksRequest*) describeProbeTasksRequest
                       completionHandler:(void(^)(int statusCode,DetectionDescribeProbeTasksResponse* _Nullable describeProbeTasksResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
DetectionDescribeProbeTasksExecutor* excutor = [[DetectionDescribeProbeTasksExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeProbeTasksRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    DetectionDescribeProbeTasksResponse* response = [[DetectionDescribeProbeTasksResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 detection common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) detectionCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)detectionCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
